﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Routing;
using System.Web.Mvc;
using Demo.HIS.FrameWork.Repository.Nhb;

namespace Demo.HIS.MVC
{
    public class DemoHISApplication : HttpApplication
    {
        protected virtual void OnStart()
        {
            initSessionBuilder();
        }

        private void initSessionBuilder()
        {
            SessionBuilder.sessionStorage = new HttpSessionStorage();   //这里创建session实例
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // 路由名称
                "{controller}/{action}/{id}", // 带有参数的 URL
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // 参数默认值
            );
        }

        protected void Application_Start()
        {
            OnStart();
        }
    }
}
